package com.steamedfish.auctioncloudadserver.controller;


import com.steamedfish.auctioncloudadserver.service.AdMailService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 高山福
 * @since 2021-04-02
 */
@RestController
@RequestMapping("/auctioncloudadserver/adMailEntity")
public class AdMailController {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private AdMailService adMailService;


//    @Scheduled(cron = "0/30 * * * * *")
    public void sendMailForAdToNewsAuction(){
        logger.info("定时发送推广" + LocalDateTime.now());
        adMailService.sendMailInterval();
    }


//    @Scheduled(cron = "0/30 * * * * *")
    public void sendMailForAdToNote(){
        logger.info("定时发送提醒拍卖" + LocalDateTime.now());
        adMailService.sendMailForNote();
    }


//    @Scheduled(cron = "0/30 * * * * *")
    public void sendMailForAdToNote1(){
        logger.info("定时发送提醒拍卖" + LocalDateTime.now());
        adMailService.sendMailForNote();
    }


}
